package com.infore.siteManagement.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;

import com.infore.siteManagement.outEntity.TPlatformCustomerStation;

public interface ITPlatformCustomerStationRepository extends JpaRepository<TPlatformCustomerStation, String> {

    List<TPlatformCustomerStation> findByPlatformId(String platformId);
    
    @Modifying
    @Transactional
    @Query(value="delete from PLATFORM_CUSTOMER_STATION where PLATFORM_ID = :platformId",nativeQuery=true)
    int delByPlatformId(@Param("platformId")String platformId);
    
    @Modifying
    @Transactional
    @Query(value="delete from PLATFORM_CUSTOMER_STATION where STATION_ID in(:ids)",nativeQuery=true)
    int delByStationId(@Param("ids")List<String> ids);

}
